﻿<%@ Page Title="Patient Master" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="PatientMaster.aspx.cs" Inherits="SAP.PatientMaster" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        Main.myUpdatePanelId = '<%= purchaseOrderUpdatePanel.ClientID %>';
    </script>
    <script language="javascript" type="text/javascript">
        function PrevImg(imgFile) {
            var Preview = document.getElementById("imgPhoto");
            Preview.src = imgFile.value;
            Preview.style.width = "200px";
            Preview.style.height = "150px";
        }
    </script>
    <asp:UpdatePanel ID="purchaseOrderUpdatePanel" runat="server">
        <Triggers>
             <asp:PostBackTrigger ControlID="btnView" />
             <asp:PostBackTrigger ControlID="SubmitButton" />
             
        </Triggers>
        <ContentTemplate>
            <div id="contentData" style="padding-left: 15px;">
            <div id="menu-action" style="margin-left: -15px;">
                    <ul id="myTab" runat="server">
                        <li><a href="#">
                            <img alt="" src="/skin/icon/preview.png" /></a></li>
                        <li><a href="#">
                            <img alt="" src="/skin/icon/print.png" /></a></li>
                        <li><a href="#">
                            <img alt="" src="/skin/icon/email.png" /></a></li>
                        <li><a href="#">
                            <img alt="" src="/skin/icon/excel.png" /></a></li>
                        <li><a href="#">
                            <img alt="" src="/skin/icon/pdf.png" /></a></li>
                        <li><a href="#">
                            <img alt="" src="/skin/icon/word.png" /></a></li>
                        
                         <li>
                            <asp:HyperLink ID="linkNew" runat="server">
                                <asp:Image ID="Image4" runat="server" ImageUrl="~/skin/icon/addnew.png" />
                             
                            </asp:HyperLink>
                        </li>
                        <li>
                            <asp:HyperLink ID="linkFirst" runat="server">
                                <asp:Image ID="Image5" runat="server" ImageUrl="~/skin/icon/first.png" />
                            
                            </asp:HyperLink>
                        </li>
                        <li>
                            <asp:HyperLink ID="linkPrevious" runat="server">
                                <asp:Image ID="Image6" runat="server" ImageUrl="~/skin/icon/previous.png" />
                            
                            </asp:HyperLink>
                        </li>
                        <li>
                            <asp:HyperLink ID="linkNext" runat="server">
                                <asp:Image ID="Image7" runat="server" ImageUrl="~/skin/icon/next.png" />
                            
                            </asp:HyperLink>
                        </li>
                        <li>
                            <asp:HyperLink ID="linkLast" runat="server">
                                <asp:Image ID="Image8" runat="server" ImageUrl="~/skin/icon/last.png" />
                            
                            </asp:HyperLink>
                        </li>
                 </ul>                    
                </div>
                <div id="title-form" style="border-bottom: 2px solid black;">
                    <h2>
                        Patient Master</h2>
                    <asp:Label BackColor="Red" ID="lblResults" runat="server" />
                </div>
                <div id="header-form">
                    <div class="left">
                        <table class="detail_table">
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>IC / Passport No.</span>
                                    <asp:DropDownList ID="ddlSeries" runat="server" Width="60px" 
                                        AutoPostBack="true" 
                                        onselectedindexchanged="ddlSeries_SelectedIndexChanged" Visible="False">
                                    </asp:DropDownList>
                                
                                </td>
                                <td>
                                    <asp:TextBox ID="txtCardCode" runat="server" Width="103px"></asp:TextBox>
                                    <asp:DropDownList ID="ddlCardType" runat="server" Width="82px" 
                                        onselectedindexchanged="ddlCardType_SelectedIndexChanged" 
                                        AutoPostBack="true" Visible="False">
                                        <asp:ListItem Text="Customer" Value="C"></asp:ListItem>
                                        <asp:ListItem Text="Vendor" Value="S"></asp:ListItem>
                                        <asp:ListItem Text="Lead" Value="L"></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>First Name</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtCardName" runat="server" Width="189px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>Last Name</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtFName" runat="server" Width="188px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>Products</span>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlBPGroup" runat="server" Width="193px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr  style="display:none">
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>IC / Passport No.</span></td>
                                <td>
                                    <asp:TextBox ID="txtLicTradNum" runat="server" Width="187px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr style="display:none">
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>Currency</span>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlCurrency" runat="server"  Width="193px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>Medical $ Balance</span></td>
                                <td>
                                    <asp:TextBox ID="txtMedialBalance" runat="server" Width="187px" Enabled="False" style="text-align: right"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                    <span>Grade</span>
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownList1" runat="server"  Width="193px">
                                        <asp:ListItem Text="Grade 1" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="Grade 2" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Grade 3" Value="3"></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="right" style="display:none">
                        
                        <table class="detail_table">
                            <tr>
                                <td class="detail_table_td_150" style="width: 98px;border-bottom: dotted 1px #808080;">
                                    <span>Account Balance</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAcctBalance" runat="server" Enabled="false" Text="" Style="text-align: right"></asp:TextBox>
                                </td>
                            </tr>
                            <tr id="trDelivery" runat="server">
                                <td class="detail_table_td_150" style="width: 98px;border-bottom: dotted 1px #808080;">
                                    <span>Deliveries</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtDelivery" runat="server" Enabled="false" Text="" Style="text-align: right"></asp:TextBox>
                                </td>
                            </tr>
                            <tr id="trOrder" runat="server">
                                <td class="detail_table_td_150" style="width: 98px;border-bottom: dotted 1px #808080;">
                                    <span>Orders</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtOrder" runat="server" Enabled="false" Style="text-align: right"></asp:TextBox>
                                </td>
                            </tr>
                            <tr id="trOppor" runat="server">
                                <td class="detail_table_td_150" style="width: 98px;border-bottom: dotted 1px #808080;">
                                    <span>Opportunities</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtOpportunity" runat="server" Enabled="false" Style="text-align: right"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <asp:Image ID="imgPhoto" runat="server" Height="130px" Width="170px" />
                    <asp:FileUpload ID="FileUpload2" runat="server" />
                    <asp:Button ID="btnView" runat="server" Text="Upload" onclick="btnView_Click" />
                    <asp:Label ID="lblOutput" runat="server" Text=""></asp:Label>
                </div>
                <div class="clear">
                </div>
                <div id="content-form">
                    <div id="tabs">
                        <ul>
                            <li><a href="#tabs-1">Personal</a></li>
                            <li><a href="#tabs-2">Emerg. Contact</a></li>
                            <li><a href="#tabs-3">Address</a></li>
                            <li><a href="#tabs-4">Attachment</a></li>
                            <li><a href="#tabs-5">Medical History</a></li>
                            <li><a href="#tabs-6">Remark</a></li>
                        </ul>
                        <div id="tabs-1" style="height:300px">
                            <table class="detail_table">
                                <tr>
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Tel 1</span>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTel1" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Company</span></td>
                                    <td>
                                        <asp:TextBox ID="txtChannelBP" runat="server"></asp:TextBox>
                                        <asp:HyperLink ID="linkVendorsLoad" NavigateUrl="javascript:Main.openDialog('../Popup_EditBusinessPartner.aspx?CardType=C','');"
                                        runat="server"> <asp:Image ID="imgVendorsLoad" runat="server" 
                                            ImageUrl="~/skin/images/item-pointer.gif" /></asp:HyperLink>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Tel 2</span>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTel2" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Occupation</span></td>
                                    <td>
                                        <asp:TextBox ID="txtNotesSAP" runat="server"></asp:TextBox>
                                        
                                    </td>
                                </tr>
                                <tr>
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Mobile Phone</span>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtMobile" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Insurance</span></td>
                                    <td>
                                        <asp:TextBox ID="txtFatherCard" runat="server"></asp:TextBox>
                                        <asp:HyperLink ID="HyperLink1" NavigateUrl="javascript:Main.openDialog('../Popup_EditBusinessPartner.aspx?CardType=C','');"
                                        runat="server"> <asp:Image ID="Image1" runat="server" 
                                            ImageUrl="~/skin/images/item-pointer.gif" /></asp:HyperLink>
                                </tr>
                                <tr>
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Fax</span>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtFax" runat="server"></asp:TextBox>
                                    </td>

                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Policy No.</span></td>
                                    <td>
                                        <asp:TextBox ID="txtAlias" runat="server"></asp:TextBox>
                                    </td>

                                   
                                </tr>
                                <tr>
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Email</span>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Known Allergy</span>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtAllergy" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Marital Status</span>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlShipping" runat="server" Width="163px" >
                                        </asp:DropDownList>
                                    </td>
                                    
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Special Notes</span></td>
                                    <td>
                                        <asp:TextBox ID="txtNotes" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Residence Status</span>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="txtPassword" runat="server" Width="163px" >
                                        <asp:ListItem Text="Singapore Citizen" Value="Singapore Citizen"></asp:ListItem>
                                        <asp:ListItem Text="Singapore PR" Value="Singapore PR"></asp:ListItem>
                                        <asp:ListItem Text="Other" Value="Other"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    

                                     <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Preferred Doctor</span></td>
                                    <td>
                                        <asp:TextBox ID="txtBPProject3" runat="server">Dr. Rirchard Leong</asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                   
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Nationality </span>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlIndustry" runat="server" Width="163px" >
                                    </asp:DropDownList>
                                    </td>
                                    <td class="detail_table_td_100" style="border-bottom: dotted 1px #808080;">
                                        <span>Last Visit</span></td>
                                    <td>
                                        <asp:TextBox ID="txtIDNo2" runat="server">01 Dec 2012</asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                        <td class="detail_table_td_150" style="width: 98px;border-bottom: dotted 1px #808080;">
                                            <span>CompanyName</span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtConCompany" runat="server" Enabled="false" Text="" Style="text-align: left"></asp:TextBox>
                                        </td>

                                        <td class="detail_table_td_150" style="width: 98px;border-bottom: dotted 1px #808080;">
                                            <span>Expiry Date</span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox1" runat="server" Enabled="false" Text="" Style="text-align: left"></asp:TextBox>
                                        </td>

                                    </tr>
                                <tr>
                                    <td class="detail_table_td_150" style="width: 98px;border-bottom: dotted 1px #808080;">
                                        <span>Remarks</span>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtConRemark" runat="server" Enabled="false" Text="" Style="text-align: left"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                            <div style="overflow:auto; height: 90px;">
                                <asp:ListView ID="lvContract" runat="server"
                                OnItemCommand="lvHistory_ItemCommand">
                                <LayoutTemplate>
                                    <table class="data_table">
                                        <tr>
                                            <th style="width: 35px">
                                                <span>#</span>
                                            </th>
                                            <th style="width: 150px">
                                                <span>Cover</span>
                                            </th>
                                            <th style="width: 140px">
                                                <span>Amount</span>
                                            </th>
                                            <th style="width: 140px">
                                                <span>Percentage</span>
                                            </th>
                                            <th style="width: 200px">
                                                <span>Detail</span>
                                            </th>
                                        </tr>
                                        <tr id="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Date" runat="server"><%#Eval("No")%></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblAdresType" Text='<%# Eval("U_Covers") %>'></asp:Label>
                                        </td>
                                        <td style="text-align: right">
                                            <asp:Label runat="server" ID="lblAddress" Text='<%# Eval("U_Amount") %>'></asp:Label>
                                        </td>
                                         <td style="text-align: right">
                                            <asp:Label runat="server" ID="Label1" Text='<%# Eval("U_Perc") %>'></asp:Label>
                                        </td>
                                         <td style="text-align: left">
                                            <asp:Label runat="server" ID="Label2" Text='<%# Eval("U_Det") %>'></asp:Label>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <EmptyDataTemplate>
                                    <table class="data_table">
                                        <tr>
                                           <<th style="width: 35px">
                                                <span>#</span>
                                            </th>
                                            <th style="width: 150px">
                                                <span>Cover</span>
                                            </th>
                                            <th style="width: 140px">
                                                <span>Amount</span>
                                            </th>
                                            <th style="width: 140px">
                                                <span>Percentage</span>
                                            </th>
                                            <th style="width: 200px">
                                                <span>Detail</span>
                                            </th>
                                        </tr>
                                        <tr>
                                            <td colspan="5">
                                                <span>No Data</span>
                                            </td>
                                        </tr>
                                    </table>
                                </EmptyDataTemplate>
                            </asp:ListView>
                            </div>
                            
                        </div>
                        <div id="tabs-2" style="height: 280px;">
                            <asp:Button ID="btnAddContact" Text="Add" runat="server"  OnClick="btnAddContact_Click" />
                            <br />
                            <asp:ListView ID="lvContactPerson" runat="server" OnItemInserted="lvContactPerson_ItemInserted"
                                OnItemCommand="lvContactPerson_ItemCommand" OnItemUpdating="lvContactPerson_ItemUpdating"
                                ViewStateMode="Enabled" OnItemEditing="lvContactPerson_ItemEditing">
                                <LayoutTemplate>
                                    <table class="data_table">
                                        <tr>
                                            <th id="thButtons" runat="server" style="width: 78px">
                                            </th>
                                            <th style="width: 25px">
                                                <span>#</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Contact ID</span>
                                            </th>
                                            <th style="width: 80px">
                                                <span>First Name</span>
                                            </th>
                                            <th style="width: 80px">
                                                <span>Middle Name</span>
                                            </th>
                                            <th style="width: 80px">
                                                <span>Last Name</span>
                                            </th>
                                            <th style="width: 30px">
                                                <span>Title</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Position</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Address</span>
                                            </th>
                                            <th style="width: 80px">
                                                <span>Telephone 1</span>
                                            </th>
                                            <th style="width: 80px">
                                                <span>Telephone 2</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Mobile Phone</span>
                                            </th>
                                            <th>
                                                <span>E-Mail</span>
                                            </th>
                                        </tr>
                                        <tr id="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="imgbEdit" runat="server" CommandName="Edit" Text="Edit" />
                                            <asp:LinkButton ID="imgbDelete" runat="server" CommandName="DeleteItem" Text="Delete"
                                                 OnClientClick="return confirm('Are you sure you want to delete this row?');"
                                                ToolTip="Delete" />
                                        </td>
                                        <td>
                                            <asp:Label runat="server" ID="lblNo" Text='<%#Eval("No")%>'></asp:Label>
                                        </td>
                                        <td  style="text-align: left">
                                            <asp:Label runat="server" ID="lblName"><%#Eval("Name") %></asp:Label>
                                        </td>
                                        <td  style="text-align: left">
                                            <asp:Label runat="server" ID="lblFirstName" Style="text-align: left"><%#Eval("FirstName")%></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblMiddleName" Text='<%# Eval("MiddleName") %>'></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblLastName" Text='<%# Eval("LastName") %>'></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblTitle"><%#Eval("Title")%></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblPosition"><%#Eval("Position")%></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblAddress"><%#Eval("Address")%></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblTel1"><%#Eval("Tel1")%></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblTel2"><%#Eval("Tel2")%></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblCellolar"><%#Eval("Cellolar")%></asp:Label>
                                        </td>
                                        <td style="text-align: left" >
                                            <asp:Label runat="server" ID="lblE_MailL"><%#Eval("E_MailL")%></asp:Label>
                                        </td>
                                       
                                    </tr>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="imgbUpdate" runat="server" CommandName="Update" Text="Update"
                                                 CausesValidation="true" ValidationGroup="vgrpSaveContact" />
                                            <asp:LinkButton ID="imgbCancel" runat="server" CommandName="CancelUpdate" Text="Cancel"
                                                 CausesValidation="false" />
                                        </td>
                                         <td>
                                            <asp:Label runat="server" ID="lblNo" Text='<%#Eval("No")%>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblName" Text='<%#Eval("Name") %>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblFirstName" Style="text-align: left" Text='<%#Eval("FirstName")%>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblMiddleName" Text='<%# Eval("MiddleName") %>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblLastName" Text='<%# Eval("LastName") %>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblTitle" Text='<%#Eval("Title")%>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblPosition" Text='<%#Eval("Position")%>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblAddress" Text='<%#Eval("Address")%>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblTel1" Text='<%#Eval("Tel1")%>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblTel2" Text='<%#Eval("Tel2")%>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblCellolar" Text='<%#Eval("Cellolar")%>' />
                                        </td>
                                        <td >
                                            <asp:TextBox runat="server" ID="lblE_MailL" Text='<%#Eval("E_MailL")%>' />
                                        </td>
                                    </tr>
                                </EditItemTemplate>
                                <EmptyDataTemplate>
                                    <table class="data_table">
                                        <tr>
                                           <th style="width: 25px">
                                                <span>#</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Contact ID</span>
                                            </th>
                                            <th style="width: 200px">
                                                <span>First Name</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Middle Name</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Last Name</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Title</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Position</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Address</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Telephone 1</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Telephone 2</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Mobile Phone</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>E-Mail</span>
                                            </th>
                                        </tr>
                                        <tr>
                                            <td colspan="12">
                                                <span>No Data</span>
                                            </td>
                                        </tr>
                                    </table>
                                </EmptyDataTemplate>
                            </asp:ListView>
                            
                        </div>
                        <div id="tabs-3" style="overflow: auto; height: 280px; margin-top: 0px;">
                            <asp:Button ID="btnAddAddress" Text="Add" runat="server" 
                                OnClick="btnAddAddress_Click" />
                          
                            <asp:ListView ID="lvAddress" runat="server" OnItemInserted="lvAddress_ItemInserted"
                                OnItemCommand="lvAddress_ItemCommand" OnItemUpdating="lvAddress_ItemUpdating"
                                ViewStateMode="Enabled" OnItemEditing="lvAddress_ItemEditing">
                                <LayoutTemplate>
                                    <table class="data_table">
                                        <tr>
                                            <th id="thButtons" runat="server" style="width: 45px">
                                            </th>
                                            <th style="width: 25px">
                                                <span>#</span>
                                            </th>
                                            <th style="width: 50px">
                                                <span>Type</span>
                                            </th>
                                            <th style="width: 200px">
                                                <span>Address</span>
                                            </th>
                                             <th style="width: 70px">
                                                <span>Building</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Street No.</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Street</span>
                                            </th>
                                        </tr>
                                        <tr id="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="imgbEdit" runat="server" CommandName="Edit" Text="Edit"  />
                                            <asp:LinkButton ID="imgbDelete" runat="server" CommandName="DeleteItem" Text="Delete"
                                                 OnClientClick="return confirm('Are you sure you want to delete this row?');"
                                                ToolTip="Delete" />
                                        </td>
                                        <td>
                                            <asp:Label runat="server" ID="lblNo" Text='<%#Eval("No")%>'></asp:Label>
                                        </td>
                                        <td Style="text-align: left">
                                            <asp:Label runat="server" ID="lblAdresType" Text='<%# Eval("AdresType") %>'></asp:Label>
                                        </td>
                                        <td Style="text-align: left">
                                            <asp:Label runat="server" ID="lblAddress" Text='<%# Eval("Address") %>'></asp:Label>
                                        </td>
                                        <td  Style="text-align: left">
                                            <asp:Label runat="server" ID="lblBuilding"><%#Eval("Building")%></asp:Label>
                                        </td>
                                        <td  Style="text-align: left">
                                            <asp:Label runat="server" ID="lblStreetNo"><%#Eval("StreetNo")%></asp:Label>
                                        </td>
                                        <td Style="text-align: left">
                                            <asp:Label runat="server" ID="lblStreet" Text='<%# Eval("Street") %>'></asp:Label>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="imgbUpdate" runat="server" CommandName="Update" Text="Update"
                                                 CausesValidation="true" ValidationGroup="vgrpSaveContact" />
                                            <asp:LinkButton ID="imgbCancel" runat="server" CommandName="CancelUpdate" Text="Cancel"
                                                 CausesValidation="false" />
                                        </td>
                                         <td>
                                            <asp:Label runat="server" ID="lblNo" Text='<%#Eval("No")%>' />
                                        </td>
                                        <td>
                                             <asp:DropDownList ID="ddlAdresType" runat="server" >
                                                <asp:ListItem Text="Bill To" Value="B"></asp:ListItem>
                                                <asp:ListItem Text="Ship To" Value="S"></asp:ListItem>
                                            </asp:DropDownList> 
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblAddress" Text='<%#Eval("Address")%>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblBuilding" Text='<%#Eval("Building")%>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblStreetNo" Text='<%# Eval("StreetNo") %>' />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" ID="lblStreet" Text='<%# Eval("Street") %>' />
                                        </td>
                                        
                                    </tr>
                                </EditItemTemplate>
                                <EmptyDataTemplate>
                                    <table class="data_table">
                                        <tr>
                                           <th style="width: 25px">
                                                <span>#</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Type</span>
                                            </th>
                                            <th style="width: 200px">
                                                <span>Address</span>
                                            </th>
                                             <th style="width: 70px">
                                                <span>Building</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Street No.</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Street</span>
                                            </th>
                                        </tr>
                                        <tr>
                                            <td colspan="6">
                                                <span>No Data</span>
                                            </td>
                                        </tr>
                                    </table>
                                </EmptyDataTemplate>
                            </asp:ListView>
<%--                            document.getElementById('FileUpload1').value--%>
                        </div>                     
                        <div id="tabs-4" style="overflow: auto;height: 280px;">
                            <asp:FileUpload ID="FileUpload1" runat="server" />
                            <asp:Button ID="SubmitButton" runat="server" Text="Submit File" OnClick="SubmitButton_Click"/>

                            
                            <br />
                           <asp:ListView ID="lvAttachments" runat="server" OnItemCommand="lvAttachments_ItemCommand">
                                <LayoutTemplate>
                                    <table class="data_table">
                                        <tr>
                                        <th id="thButtons" runat="server" style="width: 70px">
                                            </th>
                                            <th style="width: 25px">
                                                <span>#</span>
                                            </th>
                                            <th >
                                                <span>Source Path</span>
                                            </th>
                                            <th >
                                                <span>File Name</span>
                                            </th>
                                             <th >
                                                <span>Extension</span>
                                            </th>
                                            
                                        </tr>
                                        <tr ID="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="imgbDelete" runat="server" CommandName="DeleteItem" Text="Delete"
                                                ImageUrl="~/skin/icon/delete_icon_mono.gif" OnClientClick="return confirm('Are you sure you want to delete this row?');"
                                                ToolTip="Delete" />
                                        </td>
                                        <td>
                                            <asp:Label ID="No" runat="server"><%#Eval("No")%></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="srcPath" runat="server"><%#Eval("srcPath")%></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="FileName" runat="server"><%#Eval("FileName")%></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="trgtPath" runat="server"><%#Eval("FileExt")%></asp:Label>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <EmptyDataTemplate>
                                    <table class="data_table">
                                        <tr>
                                            <th style="width: 25px">
                                                <span>#</span>
                                            </th>
                                            <th >
                                                <span>Source Path</span>
                                            </th>
                                            <th >
                                                <span>File Name</span>
                                            </th>
                                            <th >
                                                <span>Extension</span>
                                            </th>
                                        </tr>
                                        <tr>
                                            <td colspan="4">
                                                <span>No Data</span>
                                            </td>
                                        </tr>
                                    </table>
                                </EmptyDataTemplate>
                            </asp:ListView>
                        </div>
                        <div id="tabs-5" style="overflow: auto; height: 280px; margin-top: 0px;">
                            <asp:TextBox ID="txtFilter" runat="server"></asp:TextBox>

                            <asp:Button ID="btnSearch" runat="server" Text="Keyword Search" 
                                onclick="btnSearch_Click" />

                            <asp:ListView ID="lvHistory" runat="server"
                                OnItemCommand="lvHistory_ItemCommand"
                                ViewStateMode="Enabled">
                                <LayoutTemplate>
                                    <table class="data_table">
                                        <tr>
                                            <th style="width: 35px">
                                                <span>#</span>
                                            </th>
                                            <th style="width: 150px">
                                                <span>Date/Time of Visit</span>
                                            </th>
                                            <th style="width: 140px">
                                                <span>Doctor</span>
                                            </th>
                                            <th style="width: 140px">
                                                <span>Clinic</span>
                                            </th>
                                            <th style="width: 200px">
                                                <span>Known Diagnosis/Problem</span>
                                            </th>
                                            <th style="width: 200px">
                                                <span>o	Treatment</span>
                                            </th>
                                        </tr>
                                        <tr id="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:HyperLink ID="lblNo" runat="server" NavigateUrl='<%# "/Sales/Prescription.aspx?order_id=" + Eval("DocEntry").ToString() %>' > 
                                                 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                                                 <asp:Label ID="Date" runat="server"><%#Eval("DocEntry")%></asp:Label>
                                            
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            </asp:HyperLink>

                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblAdresType" Text='<%# Eval("DocDate") %>'></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="lblAddress" Text='<%# Eval("SlpName") %>'></asp:Label>
                                        </td>
                                         <td style="text-align: left">
                                            <asp:Label runat="server" ID="Label1" Text='<%# Eval("WhsName") %>'></asp:Label>
                                        </td>
                                         <td style="text-align: left">
                                            <asp:Label runat="server" ID="Label2" Text='<%# Eval("U_Diagnosis") %>'></asp:Label>
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label runat="server" ID="Label4" Text='<%# Eval("U_Treatment") %>'></asp:Label>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <EmptyDataTemplate>
                                    <table class="data_table">
                                        <tr>
                                           <th style="width: 25px">
                                                <span>#</span>
                                            </th>
                                            <th style="width: 100px">
                                                <span>Date/Time of Visit</span>
                                            </th>
                                            <th style="width: 200px">
                                                <span>Doctor</span>
                                            </th>
                                            <th style="width: 200px">
                                                <span>Clinic</span>
                                            </th>
                                            <th style="width: 200px">
                                                <span>Known Diagnosis/Problem</span>
                                            </th>
                                            <th style="width: 200px">
                                                <span>Treatment</span>
                                            </th>
                                        </tr>
                                        <tr>
                                            <td colspan="6">
                                                <span>No Data</span>
                                            </td>
                                        </tr>
                                    </table>
                                </EmptyDataTemplate>
                            </asp:ListView>
                            
                        </div>
                        <div id="tabs-6">
                            <table class="detail_table">
                                <tr>
                                    <td>
                                        <CKEditor:CKEditorControl ID="txtRemark" runat="server" Height="53px" Width=""></CKEditor:CKEditorControl>
                                    </td>
                            </table>
                        </div>
                        
                    </div>
                    
                    <br />
                </div>
                <div id="footer-form">
                    <div >
                        <asp:ImageButton ID="btnAdd" runat="server" AlternateText="button" OnClientClick="Dialog.showLoader();"
                            CommandName="Login" Height="18px" Width="65px" ImageUrl="~/skin/images/SAP_Add.png"
                            OnClick="btnAdd_Click" />
                        <asp:ImageButton ID="btnUpdate" runat="server" AlternateText="button" Height="18px"
                            ImageUrl="~/skin/images/SAP_update.png" onclick="btnUpdate_Click" 
                            OnClientClick="Dialog.showLoader();"/>
                        <asp:ImageButton ID="btnActivity" runat="server" AlternateText="button" 
                            ImageUrl="~/skin/images/SAP_Appointment.png" onclick="btnActivity_Click" 
                            OnClientClick="Dialog.showLoader();"/>
                        
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div id="Div1" style="padding-left: 15px;">
        <table class="detail_table">
            
        </table>
    </div>
    
    
</asp:Content>
